package com.example.rikao1023.viewmodel

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.viewModelScope
import com.example.rikao1023.base.BaseViewMOdel
import com.example.rikao1023.bean.BeanLogin
import com.example.rikao1023.bean.Datalogin
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext

class RegViewModel:BaseViewMOdel() {
    val successreg=MutableLiveData<BeanLogin<Datalogin>>()

    fun reg(map: HashMap<String,String>){
        viewModelScope.launch {
            withContext(Dispatchers.IO){
                successreg.postValue(apiSeriver.reg(map))
            }
        }
    }
}